//#pragma once

#include <stdexcept>
using namespace std;
extern struct DataType;
const int defMaxListSize=10;

class List
{
public:
	List(int maxNumber=defMaxListSize)throw(bad_alloc);
	~List(void);
	virtual void insert(const DataType & newDataItem)throw(logic_error);
	void clear();
	bool isEmpty()const;
	bool isFull()const;
	void gotoBeginning();
	void gotoEnd();
	bool gotoNext();
	bool gotoPrior();
	DataType getCursor()const;
	void showStructure();
	bool retrieve(char searchKey, DataType& searchDataItem)const;
	void remove();
	virtual void replace(const DataType& newDataItem);
protected:
	int maxSize;
	int size;
	int cursor;
	DataType*dataItems;
};

